1. Field of the Invention
This invention relates to a code generating apparatus, an image-processing apparatus, a code generating program, an image-processing program, and a memory medium.
2. Description of the Related Art
Digital information (digital contents) such as digital images can easily be copied by use of computers or the like without degrading information. With the development of digital imaging technology, it is now becoming possible to use digital images or the like acquired by digital cameras or the sort as photographic evidence. Copyright protection or the like may cover such digital contents, so that it may be prohibited to make unauthorized copies and to use the copies of digital contents.
Digital contents are easy to alter through the rewriting of contents by simple modification processing or the like. For this reason, measures are sometimes taken to prevent digital contents from being copied for unauthorized use or being partially altered for use as photographic evidence.
Such measures include a technology that prevents unauthorized use of digital contents through digital watermarking or data hiding, which adds information to the digital contents such as digital images such that the added information is not visible when the digital contents are replayed in an ordinary fashion. This makes it possible to decide whether digital contents are properly used based on digital watermarking embedded into the digital contents.
The use of digital watermarking embedded into digital contents includes the following applications:                A. recording of copyright information;        B. tracing of people who made unauthorized copies;        C. history of IP addresses;        D. prevention of unauthorized copying (invisible and high tolerance);        E. prevention of alteration (invisible and low tolerance);        F. authentication;        G. secret communication        H. embedding of notes or labels about digital contents for the purpose of marking ownership (visible and irreversible); and        I. distribution of contents with capacity to remove watermarking (visible and reversible).        
Usage for “E. prevention of alteration” for the purpose of protecting the right of content authors may be as follows.
There is a technology that embeds a watermark into a digital image and generates an electronic signature when a photograph is taken by use of a digital camera, the watermark indicating a serial number of the digital camera and the date and, time of the photograph. Digital watermarking technology is utilized in addition to the electronic signature technology, which generally provides for alteration check. This makes it possible not only to detect alteration that is made to the digital image but also to identify the digital camera used for photographing and the data and time of photographing. Alteration of digital images is thus more effectively prevented (see Non-patent Document 1).
The technology of embedding digital watermarking into digital contents (hereinafter referred to as a digital-watermarking technology) breaks down into two groups: (1) a technology that embeds digital watermarking directly into the sample points of contents data; and (2) a technology that embeds digital watermarking into the frequency components of contents data.
The method of embedding digital watermarking into the sample points of data requires undemanding processing for modifying and compressing of digital contents. When modification or compression is applied to the digital contents with embedded digital watermarking, however, the embedded digital watermarking may easily be destroyed.
On the other hand, the method of embedding a watermark into frequency components requires heavy processing for embedding and extracting the watermark into and from digital contents. This method, however, is robust against modification or compression that is made to the digital contents with embedded digital watermarking.
In black and white printing for monochrome digital copy, monochrome facsimile, monochrome newspaper, etc., a lossless image compression method is recommended and generally used that uses a black/white binary image and reconstructs an original image without any loss. Such a lossless image compression method includes MH, MR, MMR, etc., which are G3 and G4 standards of the International Telecommunications Union (ITU-T).
However, these methods have drawbacks in that coding efficiency is poor for halftone images or error diffused images, and may fail to compress data.
As a measure to obviate this problem, an arithmetic coding system that attends to coding based on image entropy is attracting attention. JBIG, which is a group that examines the international standard of a new coding system for binary images, for example, has adopted an arithmetic coding system referred to as QM-Coder. The QM-Coder arithmetic coding system is recommended as an ITU-T standard.
In products such as digital still/video cameras that handle multi-value images like digital color images or gray-scale images, for example, it is becoming more common to use a lossy compression technology by placing an emphasis on a compression rate for data storage while compromising on image degradation such as the loss of fine information on an original image. Such lossy compression technology includes JPEG, MPEG, etc., which employ frequency transformation based on the discrete cosine transform (DCT).
As a next standard after JPEG, further, JPEG2000 is a focus of a lot of attention as a consolidated coding method for binary data and multi-value data and also as a consolidated coding method for a lossy coding system and a lossless coding system. JPEG2000 uses the discrete wavelet transform (DWT) to reduce the degradation of image quality at the time of high compression rates, and also employs an MQ-Coder to achieve a high compression rate. The MQ-Coder resembles the QM-Coder of JB IG previously described, and is an arithmetic coding method which is employed by JBIG2.
[Non-Patent Document 1]
Investigative-report regarding the digital watermarking technology, March, 1999: Edited by Japan Electronic Industry Development Association (Daigen: Nikkei business: prevention of illegal coping of electronic information, February 23, pp. 68-70 (1998))
When the technology (1) as previously described is used to embed digital watermarking into the digital contents of compressed multi-value images, image quality deteriorates due to a coding process for image compression that is performed at the time of storing digital contents. Together with this image deterioration, the digital watermarking embedded into the digital contents also deteriorates. The larger the number of occurrences at which coding for compression and decoding for decompression are repeated, the weaker the capability becomes to detect digital watermarking embedded into digital contents.
There is thus a need to detect digital watermarking even after repeated coding and decoding processes when the embedding of digital watermarking is aimed at detecting the alteration of digital contents. It is thus reasonable to employ the technology (2) of embedding digital watermarking into code sequence data (frequency components) when compressed digital contents are to be stored.
There is a need for a scheme that allows the position of alteration to be detected on a block-specific basis without the deterioration of digital watermarking even after repeated coding and decoding processes performed on image data.